#!/usr/bin/env bash

echo "begining"
jar_name=ruoyi-admin.jar
echo $PROJECT_PATH $jar_name

echo "Stopping" ${jar_name}
pid= `ps -ef | grep $jar_name | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
echo "kill -9 的pid:" $pid
kill - 9 $pid
fi

echo "Execute shell Finish"

cd ${PROJECT_PATH}/RuoYi
mvn clean install

cd ${PROJECT_PATH}/RuoYi/ruoyi-admin/target/
nohup java -jar ${jar_name} &

